package com.dulian.wallet.controller;

import com.dulian.wallet.common.Result;
import com.dulian.wallet.entity.UserWalletRecord;
import com.dulian.wallet.service.UserWalletRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/userWalletRecord")
public class UserWalletRecordController {
    @Autowired
    private UserWalletRecordService userWalletRecordService;

    /**
     * 查询用户钱包金额变动明细
     * @param userId
     * @return
     */
    @GetMapping("/getDetails/{userId")
    public Result getDetails(@PathVariable String userId){
        List<UserWalletRecord> list = userWalletRecordService.getDetails(userId);
        return Result.ok(list);
    }
}
